home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
inet
/
internet-drafts
/
2-nroff.template
< prev
next >
Wrap
Text File
|
1993-03-03
|
6KB
|
226 lines
Internet-Draft J. Postel
24-June-91
RFC "nroff macros"
Status
This odd Internet Draft is posted for the convenience of authors who
wish to prepare documents in the style of RFC's. This style is
compatable with Internet Drafts with the addition of a few guidelines
listed in the file IETF/1id-guidelines in all the IETF directories.
Generally, we use the very simplest nroff features. We use the "ms"
macros. So, "nroff -ms input-file > output-file". However, we could not
get nroff to do the right thing about putting a form feed after the last
visible line on a page and no extra line feeds before the first visible
line of the next page. We want:
last visible line on page i
^L
first visible line on page i+1
So, we invented some hacks to fix this including a "sed" script called
"fix.sh" and a "c" program we called "pg" (pg is called from fix). So
the command to process the file becomes:
nroff -ms input-file | fix.sh > output-file
Now as to the nroff features we actually use, I'll append a sample memo,
prepared in RFC style.
The sed script fix.sh is:
sed -e 's/FORMFEED\[Page/ \[Page/' $* | pg -n5
The pg program is:
~Begining of pg program~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*
* $Header$
*
* Remove N lines following any line that contains a form feed (^L).
* (Why can't this be done with awk or sed?)
*
* OPTION:
* -n# Number of lines to delete following each ^L (0 default).
* $Log$
*/
#include <stdio.h>
#define FORM_FEED '\f'
#define OPTION "n:N:" /* for getopt() */
extern char *optarg;
extern int optind;
main(argc, argv)
int argc;
char *argv[];
{
int c, /* next input char */
nlines = 0; /* lines to delete after ^L */
void print_and_delete(); /* print line starting with ^L,
then delete N lines */
/*********************** Process option (-nlines) ***********************/
while ((c = getopt(argc, argv, OPTION)) != EOF)
switch(c)
{
case 'n' :
case 'N' : nlines = atoi(optarg);
break;
}
/************************* READ AND PROCESS CHARS **********************/
while ((c = getchar()) != EOF)
if (c == FORM_FEED)
print_and_delete(nlines); /* remove N lines after this one */
else
putchar(c); /* we write the form feed */
exit(0);
}
/*
* Print rest of line, then delete next N lines.
*/
void print_and_delete(n)
int n; /* nbr of lines to delete */
{
int c, /* next input char */
cntr = 0; /* count of deleted lines */
while ((c = getchar()) != '\n') /* finish current line */
putchar(c);
putchar('\n'); /* write the last CR */
putchar(FORM_FEED);
for ( ; cntr < n; cntr++)
while ((c = getchar()) != '\n')
if (c == EOF)
exit(0); /* exit on EOF */
putchar(c); /* write that last CR */
}
~End of pg program~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hope this helps,
- --jon.
~Begining of sample nroff RFC~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.pl 10.0i
.po 0
.ll 7.2i
.lt 7.2i
.nr LL 7.2i
.nr LT 7.2i
.ds LF Drissel
.ds RF FORMFEED[Page %]
.ds CF
.ds LH RFC DRAFT
.ds RH February 1987
.ds CH
.hy 0
.ad l
Network Working Group W. Drissel
Request for Comments: DRAFT CyberScribe Associates
February 1987
.sp 2
.ce
Final Report of ANSI Committee LY-2299-BS
.sp 2
.fi
.ne 4
Status of this Memo
.sp
.in 3
This RFC is being distributed to members of the
Internet community in order to solicit their reactions
to the proposals contained in it. While the issues
discussed may not be directly relevant to the research
problems of the Internet, they may be interesting to a
number of researchers and implementers.
Distribution of this memo is unlimited.
.sp
.in 0
.ne 4
Proposed ANSI Standard Mendacity Scale
.sp
.nf
Class I Lies
Class II Damn Lies
Class III Statistics
Class IV Damn Statistics
Class V Benchmarks
Class VI Delivery Promises
Class VII Campaign Promises
.fi
.sp
.in 0
.ne 4
Discussion
.sp
.in 3
The committee felt it desirable to include the following explanatory notes:
(1) Class IV lies are distinguished from Class III lies by the willful
abuse statistical practice. For example, "Brand A lasts up to twice
as long as the average of the five leading brands". This example
compares the one best sample of Brand A with an average -- trying to
give the impression of the superiority when a comparison of the
average of Brand A and the rest may have demonstrated an inferiority.
A second example is "Brand A lasts longer -- 30.3 months compared
with 30.2 months for the competition". This example ignores the
principle of statistical significance.
(2) Class VII lies are distinguished from Class VI lies by the
fact that nearly every delivery promise is EVENTUALLY followed by
delivery.
.sp
.in 0
.ne 4
Author's Note:
.sp
.in 3
I've embellished the original scale but have, unfortunately, forgotten
its source. If anyone can find the original reference, please send
it to me so the original author can be suitably remembered in the standard.
.sp
.in 0
Security Considerations
.sp
.in 3
Security considerations ane not discussed in this memo.
.in 0
.ne 5
Author's Address:
.sp
.in 3
.nf
William E. Drissel
CyberScribe Associates
Grand Prairie, Texas
.fi
.sp
.in 0
Editor's Note:
.sp
.in 3
This report is reprinted from IEEE Computer, February 1987.
~End of sample nroff RFC~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------- End of Forwarded Message